package com.adui.mgt.performance.service.base;

import com.adui.mgt.performance.entity.BaseEntity;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;
import java.util.function.Function;

public interface IBaseService<M extends BaseMapper<T>, T extends BaseEntity> extends IService<T> {

	public M getMapper();

	public int[] replace(List<T> oldList, List<T> newList);

	public int[] replace(Wrapper<T> queryWrapper, List<T> newList);

	public int[] replace(SFunction<T, ?> column, Object val, List<T> newList);

	public int[] replace(SFunction<T, ?> column1, Object val1, SFunction<T, ?> column2, Object val2, List<T> newList);

	public <A> A getValueById(Function<T, A> target, String id);

	public <A> A getValueBy(Function<T, A> target, SFunction<T, ?> column, Object val);

	public <A> A getValueBy(Function<T, A> target, SFunction<T, ?> column1, Object val1, SFunction<T, ?> column2, Object val2);

}
